home *** CD-ROM | disk | FTP | other *** search
- /* p877.c --- bible */
- #include <alloc.h>
- #include <conio.h>
- char text[] = "Testing gettext/puttext. Press any key to go on.";
- main()
- {
- int i, left = 20, right = 60, top = 10, bottom = 20, bufsize;
- char *tbuffer;
- for(i = 1; i <= 25; i++)
- {
- gotoxy(1, i);
- cputs(text);
- }
- getch();
- bufsize = 2 * (bottom - top + 1) * (right - left + 1);
- if((tbuffer = (char *)malloc(bufsize)) == NULL)
- {
- cputs("Error allocating buffer");
- exit(1);
- }
- if(!gettext(left, top, right, bottom, tbuffer))
- {
- cputs("Error saving text!");
- exit(1);
- }
- getch();
- window(left, top, right, bottom);
- textbackground(RED);
- clrscr();
- getch();
- textcolor(YELLOW);
- gotoxy(2, 4);
- getch();
- cputs("Pop-up Menu is easy in Turbo C.");
- gotoxy(2, 10);
- cputs("Press a key to exit menu: ");
- getch();
- if(!puttext(left, top, right, bottom, tbuffer))
- cputs("Error restoring text!");
- getch();
- }